n = int(input())
m = []
for r in range(n):
    m.append(input().split())

def find_saddle_point(matrix):

    for i in range(n):
        max_row_num = max(matrix[i])

        # print("max_row_num:{}".format(max_row_num))

        for j in range(n):
            min_col_num = min([matrix[k][j] for k in range(n)])
            # print("min_col_num:{}".format(min_col_num))

            if matrix[i][j] == max_row_num and matrix[i][j] == min_col_num:
                return i, j

    return "NONE"

print(find_saddle_point(m))